package com.yitao.client.constant;

import java.util.HashMap;
import java.util.Map;

public class PackageEnum {


    public enum PackageTypeEnum {
        //'1 CC包裹  2 BC包裹 3 国内普通快递',
        CC(1, "CC包裹"),
        BC(2, "BC包裹"),
        Express(3, "国内普通快递");

        private static final Map<Integer, PackageTypeEnum> map = new HashMap<>();

        static {
            PackageTypeEnum[] values = PackageTypeEnum.values();
            for (PackageTypeEnum item : values) {
                map.put(item.code, item);
            }
        }

        private final Integer code;
        private final String name;

        private PackageTypeEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static PackageTypeEnum getEnum(Integer code) {
            return map.get(code);
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }

    public enum PackageStatusEnum {
        //物流状态 10:备货中 20:待发货 30:已发货 40:已签收
        IN_THE_STOCK(OrderStatusEmnu.LOGISTIC_STATUS.IN_THE_STOCK.getCode(), "备货中"),
        WAIT_SHIP(OrderStatusEmnu.LOGISTIC_STATUS.WAIT_SHIP.getCode(), "待发货"),
        SHIPPED(OrderStatusEmnu.LOGISTIC_STATUS.SHIPPED.getCode(), "已发货"),
        HAVE_BEEN_SIGNED(OrderStatusEmnu.LOGISTIC_STATUS.HAVE_BEEN_SIGNED.getCode(), "已签收");

        private static final Map<Integer, PackageStatusEnum> map = new HashMap<>();

        static {
            PackageStatusEnum[] values = PackageStatusEnum.values();
            for (PackageStatusEnum item : values) {
                map.put(item.code, item);
            }
        }

        private final Integer code;
        private final String name;

        private PackageStatusEnum(Integer code, String name) {
            this.code = code;
            this.name = name;
        }

        public static PackageStatusEnum getEnum(Integer code) {
            return map.get(code);
        }

        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }
    }


}
